{template '_header'}

<div class="page-header">
    当前位置：<span class="text-primary">提现申请详情</span>
</div>

<div class="page-content">
<div class="step-region" >
    <ul class="ui-step ui-step-4" >
        <li {if $apply['status']>=1}class="ui-step-done"{/if}>
            <div class="ui-step-title" >申请中</div>
            <div class="ui-step-number" >1</div>
            <div class="ui-step-meta" >{if 1<=$apply['status']}{php echo date('Y-m-d',$apply['createtime'])}<br/>{php echo date('H:i:s',$apply['createtime'])}{/if}</div>
        </li>
        <li  {if $apply['status']>=2}class="ui-step-done"{/if}>
            <div class="ui-step-title">商家审核</div>
            <div class="ui-step-number">2</div>
            <div class="ui-step-meta">{if 2<=$apply['status']}{php echo date('Y-m-d',$apply['checktime'])}<br/>{php echo date('H:i:s',$apply['checktime'])}{/if}</div>
        </li>
        <li {if $apply['status']>=3}class="ui-step-done"{/if}>
            <div class="ui-step-title">商家打款</div>
            <div class="ui-step-number" >3</div>
            <div class="ui-step-meta" >{if 3<=$apply['status']}{php echo date('Y-m-d',$apply['paytime'])}<br/>{php echo date('H:i:s',$apply['paytime'])}{/if}</div>
        </li>
        <li {if $apply['status']==4}class="ui-step-done"{/if}>
            <div class="ui-step-title">无效</div>
            <div class="ui-step-number" >!</div>
            <div class="ui-step-meta" >{if -1==$apply['status']}{php echo date('Y-m-d',$apply['invalidtime'])}<br/>{php echo date('H:i:s',$apply['invalidtime'])}{/if}</div>
        </li>
    </ul>
</div>

<form {ifp 'sorder.withdrawal.check|sorder.withdrawal.pay|sorder.withdrawal.cancel'}action="" method='post'{/if} class='form-horizontal form-validate'>

    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="sorder.withdrawal" />
    <input type="hidden" name="id" value="{$apply['id']}" />
    
    <div class="panel panel-default">
        <div class='panel-heading'>
            提现者信息
        </div>
        <div class='panel-body'>
            <div style='height:auto;width:120px;float:left;'>
                <img src='{$apply['avatar']}' style='width:100px;height:100px;border:1px solid #ccc;padding:1px' />
            </div>
            <div style='float:left;height:auto;overflow: hidden;width:600px'>
                <p><b>昵称:</b> {$apply['realname']}  &nbsp; &nbsp; <b>姓名:</b> {$apply['realname']} &nbsp; &nbsp; <b>手机号:</b> {$apply['mobile']} &nbsp; &nbsp; <b>微信号:</b> {$apply['weixin']}</p>
                <p>
                    <b>收入佣金记录(=累计佣金): </b><span style='color:red'>{php echo number_format($logtotal, 2)}</span> 元  &nbsp; &nbsp;
                    <b>提现佣金记录(=已提现佣金): </b><span style='color:red'>{php echo number_format($logdrawal, 2)}</span> 元 &nbsp; &nbsp;
                </p>
                <p>
                    <b>累计佣金: </b><span style='color:red'>{php echo number_format($comm['total'], 2)}</span> 元  &nbsp; &nbsp;
                    <b>待审核佣金: </b><span style='color:red'>{php echo number_format($comm['ischeck'], 2)}</span> 元 &nbsp; &nbsp;
                    <b>待打款佣金: </b><span style='color:red'>{php echo number_format($comm['ispay'], 2)}</span> 元 &nbsp; &nbsp;
                </p>
                <p>
                    <b>申请佣金: </b><span style='color:red'>{php echo number_format($apply['money'], 2)}</span> 元 &nbsp; &nbsp;
                    <b>剩余佣金: </b><span style='color:red'>{php echo number_format($comm['remain'], 2)}</span> 元 &nbsp; &nbsp;
                    <b>已提现佣金: </b><span style='color:red'>{php echo number_format($comm['drawal'], 2)}</span> 元 &nbsp; &nbsp;
                    <b>提现冻结佣金: </b><span style='color:red'>{php echo number_format($comm['freeze'], 2)}</span> 元
                </p>
                {if (float)$apply['sendmoney']}
                <p>
                    <b>已打款(红包才有): </b><span style='color:red'>{php echo number_format($apply['sendmoney'])}</span> 元
                </p>
                {/if}
                <p>
                    <b>打款方式: </b>
                    {if empty($apply['type'])}
                    <span class='label label-primary'>{$paytype[$apply['type']]['title']}</span>
                    {else if $apply['type'] == 1}
                    <span class='label label-success'>{$paytype[$apply['type']]['title']}</span>
                    {else if $apply['type'] == 2}
                    <span class='label label-warning'>{$paytype[$apply['type']]['title']}</span> &nbsp; &nbsp;
                    <b>姓名: </b><span style='color:red' id="realname">{$apply['realname']}</span> &nbsp; &nbsp;
                    <b>支付宝帐号: </b><span style='color:red' id="alipay">{$apply['alipay']}</span>
                    {else if $apply['type'] == 3}
                    <span class='label label-danger'>{$paytype[$apply['type']]['title']}</span> &nbsp; &nbsp;
                    <b> 姓名: </b><span style='color:red' id="realname">{$apply['realname']}</span> &nbsp; &nbsp;
                    <b> 银行: </b><span style='color:red' id="bankname">{$apply['bankname']}</span> &nbsp; &nbsp;
                    <b> 卡号: </b><span style='color:red' id="bankcard">{$apply['bankcard']}</span>
                    {/if}
                </p>


            </div>
        </div>

        {if $apply['status']==2 || $apply['status']==3}
        <div class='panel-heading'>
            打款信息
        </div>
        <div class='panel-body'>
            此次佣金总额:  <span style='color:red'>{$apply['money']}</span> 元
            实际打款：<span style='color:red'>{$apply['money']}</span> 元
            实际到账：<span style='color:red'>
                {$apply['realmoney']}
            </span> 元
            个人所得税金额：<span style='color:red'>{$apply['tax']}</span> 元
            个人所得税：<span style='color:red'>{$apply['taxmoney']}%</span>
        </div>
        {/if}

    </div>  
    <div class="form-group col-sm-12">
        {if $apply['status']==1}
        {ifp 'sorder.apply.refuse'}
        <input type="submit" name="submit_refuse" value="驳回申请" class="btn btn-danger" onclick='return refuse()'/>
        {/if}
        {ifp 'sorder.apply.check'}
        <input type="submit" name="submit_check" value="提交审核" class="btn btn-primary" onclick='return check()'/>
        {/if}
        {/if}

        {if $apply['status']==2}

        {ifp 'sorder.apply.cancel'}
        <input type="submit" name="submit_cancel" value="重新审核" class="btn btn-default"  onclick='return cancel()'/>
        {/if}
        {ifp 'sorder.apply.pay'}
        {if empty($apply['type'])}
        <input type="submit" name="submit_pay" value="打款到余额账户" class="btn btn-primary"  style='margin-left:10px;' onclick='return pay_credit()'/>
        {else if $apply['type'] == 1}
        <input type="submit" name="submit_pay" value="打款到微信钱包" class="btn btn-primary" style='margin-left:10px;' onclick='return pay_weixin()'/>
        {else if $apply['type'] == 2}
        <input type="submit" name="submit_pay" value="确认打款到支付宝" class="btn btn-primary" style='margin-left:10px;' onclick='return pay_alipay()'/>
        {else if $apply['type'] == 3}
        <!--<input type="submit" name="submit_pay" value="确认打款到银行卡" class="btn btn-primary" style='margin-left:10px;' onclick='return pay_bank()'/>-->

        {/if}
        <input type="submit" name="submit_pay" value="手动处理" class="btn btn-warning" style='margin-left:10px;' onclick='return payed()'/>
        {/if}
        {/if}
        {if $apply['status']==4}
        {ifp 'sorder.withdrawal.cancel'}
        <!--<input type="submit" name="submit_cancel" value="重新审核" class="btn btn-default"  onclick='return cancel()'/>-->
        {/if}

        {/if}

        <input type="button" class="btn btn-default" name="submit" onclick="history.go(-1)" value="返回" style='margin-left:10px;' />

    </div>
</form>
</div>
<script language='javascript'>
    function checkall(ischeck) {
        var val = ischeck ? 2 : -1;

        $('.status1,.status2,.status3').each(function () {
            $(this).closest('.input-group-addon').find(":radio[value='" + val + "']").get(0).checked = true;
        });
    }
    function check() {
        $(':input[name=r]').val('sorder.withdrawal.check');
        return confirm('确认已核实成功并要提交?\r\n(提交后还可以撤销审核状态, 申请将恢复到申请状态)');
    }
    function refuse() {
        $(':input[name=r]').val('sorder.withdrawal.refuse');
        return confirm('确认驳回申请?\r\n( 用户可以重新提交提现申请)');
    }
    function cancel() {
       $(':input[name=r]').val('sorder.withdrawal.cancel');
        return confirm('确认撤销审核?\r\n( 所有状态恢复到申请状态)');
    }
    function pay_credit() {
        $(':input[name=r]').val('sorder.withdrawal.wpay');
        return confirm('确认打款到此用户的余额账户?');
    }
    function pay_weixin() {
        $(':input[name=r]').val('sorder.withdrawal.wpay');
        return confirm('确认打款到此用户的微信钱包?');
    }
    function pay_alipay() {
        $(':input[name=r]').val('sorder.withdrawal.wpay');
        return confirm('确认打款到此用户的支付宝? 姓名:' + $("#realname").html() + ' 支付宝帐号:' + $("#alipay").html());
    }

    function pay_bank() {
        $(':input[name=r]').val('sorder.withdrawal.wpay');
        return confirm('确认打款到此用户的银行卡? ' + $("#bankname").html() + ' 姓名: 卡号:' + $("#bankcard").html());
    }

    function payed() {
        $(':input[name=r]').val('sorder.withdrawal.payed');
        return confirm('选择手动处理 , 系统不进行任何打款操作!\r\n请确认你已通过线下方式为用户打款!!!\r\n是否进行手动处理 ');
    }
</script>

{template '_footer'}